import request from '@/utils/requets'
import type { loginData, ReturnLoginData, ReturnUser } from './type'
enum API {
    LOGIN_URL = '/admin/acl/index/login',
    USER_URL = '/admin/acl/index/info',
    LOGINON_URL = '/admin/acl/index/logout',
}
// 登录 接口
export const login = (data: loginData) => {
    return request<any, ReturnLoginData>({
        method: 'post',
        url: API.LOGIN_URL,
        data,
    })
}

// 获取用户信息
export const getUser = () => {
    return request<any, ReturnUser>({
        method: 'get',
        url: API.USER_URL,
    })
}

// 退出登录
export const reqLogin = () => {
    return request<any, any>({
        method: 'post',
        url: API.LOGINON_URL,
    })
}
